﻿<UserControl x:Class="navigation.Contents.BacklogScreen"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:s="http://schemas.microsoft.com/surface/2008"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
             xmlns:data="clr-namespace:navigation.Data"
             xmlns:content="clr-namespace:navigation.Contents"
             xmlns:control="clr-namespace:navigation.Controls" 
             mc:Ignorable="d" 
             x:Name="Backlog"
             d:DesignHeight="972" d:DesignWidth="1920">
    <UserControl.Resources>
        <data:ScatterViewItemDataTemplateSelector x:Key="ScatterViewItemDataTemplateSelector"/>

        <Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type s:SurfaceToggleButton}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ToggleButton}">
                        <Border Padding="{TemplateBinding Padding}">
                            <Grid Background="Transparent" SnapsToDevicePixels="False">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="19"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Ellipse x:Name="circle" HorizontalAlignment="Center" Height="19" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="false" Stroke="#666" StrokeThickness="2" VerticalAlignment="Center"/>
                                <ContentPresenter Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="true">
                                <Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
                                <Setter Property="Stroke" TargetName="arrow" Value="#222"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
                                <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
                                <Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <ImageBrush x:Key="DeleteIcon" Stretch="Uniform"  ImageSource="/Resources/delete.png"/>

        <Image x:Shared="false" x:Key="IconFileEdit" Source="/navigation;component/Resources/Icons/edit.png"/>
        <Image x:Shared="false" x:Key="IconFileDelete" Source="/navigation;component/Resources/Icons/delete.png"/>
        <Image x:Shared="false" x:Key="IconFileHelp" Source="/navigation;component/Resources/Icons/help.png"/>
        <Image x:Shared="false" x:Key="IconFilePrint" Source="/navigation;component/Resources/Icons/print.png"/>
        <Image x:Shared="false" x:Key="IconFileTrash" Source="/navigation;component/Resources/Icons/trash.png"/>
        <Image x:Shared="false" x:Key="IconMail" Source="/navigation;component/Resources/Icons/mail.png"/>
        <Image x:Shared="false" x:Key="IconTools" Source="/navigation;component/Resources/Icons/tools.png"/>

        <DataTemplate x:Key="EditIcon">
            <Grid>
                <Image Source="/Resources/pencil.png" Stretch="Uniform"/>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="LockIcon">
            <Grid>
                <Image Source="/Resources/lock.png" Stretch="Uniform"/>
            </Grid>
        </DataTemplate>

        <Style x:Key="MyFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Control}">
                        <Grid Margin="8">
                            <Ellipse Name="r1" Stroke="Black" StrokeDashArray="2 2" StrokeThickness="1"/>
                            <Border Name="border" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}" BorderThickness="1" CornerRadius="2"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="CircleButton" TargetType="s:SurfaceButton">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="Margin" Value="2"/>
            <Setter Property="FocusVisualStyle" Value="{StaticResource MyFocusVisual}"/>
            <Setter Property="Background" Value="#FF6DB4EF"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <Ellipse Fill="{StaticResource DeleteIcon}"/>
                            <Ellipse>
                                <Ellipse.Fill>
                                    <RadialGradientBrush>
                                        <GradientStop Offset="0" Color="#00000000"/>
                                        <GradientStop Offset="0.88" Color="#00000000"/>
                                        <GradientStop Offset="1" Color="#80000000"/>
                                    </RadialGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Ellipse Margin="10" x:Name="highlightCircle" >
                                <Ellipse.Fill >
                                    <LinearGradientBrush >
                                        <GradientStop Offset="0" Color="#50FFFFFF"/>
                                        <GradientStop Offset="0.5" Color="#00FFFFFF"/>
                                        <GradientStop Offset="1" Color="#50FFFFFF"/>
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter TargetName="highlightCircle" Property="Fill">
                                    <Setter.Value>
                                        <LinearGradientBrush StartPoint="0.3,0" EndPoint="0.7,1">
                                            <GradientStop Offset="0" Color="#50FFFFFF"/>
                                            <GradientStop Offset="0.5" Color="#00FFFFFF"/>
                                            <GradientStop Offset="1" Color="#50FFFFFF"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter TargetName="content" Property="RenderTransform">
                                    <Setter.Value>
                                        <TranslateTransform Y="0.5" X="0.5"/>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <DataTemplate x:Key="ProductBacklogItemDataTemplate">
            <Grid>
                <StackPanel Orientation="Vertical" Width="280" MinWidth="140" MaxWidth="560" HorizontalAlignment="Center">
                    <StackPanel Orientation="Horizontal">
                        <s:SurfaceToggleButton Style="{StaticResource ExpanderDownHeaderStyle}" Margin="1,1,1,1" Click="SurfaceToggleButton_Click"/>
                        <Label Width="200" Height="40" VerticalAlignment="Center" VerticalContentAlignment="Center" Content="{Binding StoryName}" FontFamily="Arial" FontSize="15" Foreground="Black"/>
                        <Ellipse Fill="{Binding State, UpdateSourceTrigger=PropertyChanged}" Height="15" Width="15" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </StackPanel>
                    <TextBlock Width="280" HorizontalAlignment="Stretch" Height="Auto" Text="{Binding StoryContent}" FontFamily="Arial" FontSize="15" Foreground="Black" Visibility="{Binding StoryContentState, UpdateSourceTrigger=PropertyChanged}"/>
                </StackPanel>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="ScatterViewItemDataTemplate">
            <!--<Grid>
                <control:FlipStoryCard Width="400" Height="300" StoryName="{Binding StoryName}" StoryContent="{Binding StoryContent}" StoryPoints="{Binding StoryPoints}" SnapsToDevicePixels="True"/>
            </Grid>-->

            <Grid Name="taskGrid" AllowDrop="True">
                <StackPanel Orientation="Vertical" Background="White" Opacity="0.8">
                    <s:SurfaceTextBox Name="StoryNameTextBox" Height="40" Width="200" HorizontalAlignment="Left" Text="{Binding StoryName, Mode=TwoWay}" Focusable="False" BorderBrush="White" BorderThickness="1" FontFamily="Arial" FontSize="17" FontStyle="Italic" Foreground="Black" Background="Transparent"/>
                    <s:SurfaceTextBox Name="StoryContentTextBox" Height="50" Margin="5" HorizontalAlignment="Left" Text="{Binding StoryContent, Mode=TwoWay}" Focusable="False" BorderBrush="White" BorderThickness="1" FontFamily="Arial" FontSize="15" Foreground="Black" Background="Transparent"/>
                    <StackPanel Height="40" Orientation="Horizontal" FlowDirection="RightToLeft">
                        <TextBlock Margin="2" HorizontalAlignment="Right" Text="{Binding StoryPoints}" FontFamily="Arial" FontSize="15" Foreground="Black"/>
                        <TextBlock Margin="2" HorizontalAlignment="Right" Text=":Story Points" FontFamily="Arial" FontSize="15" Foreground="Black"/>
                    </StackPanel>
                    <Canvas Name="taskListCanvas" Height="200">
                        <Canvas.Resources>
                            <Style TargetType="{x:Type Canvas}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding ShowTaskList}" Value="Visible">
                                        <Setter Property="Visibility" Value="Visible"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding ShowTaskList}" Value="Collapsed">
                                        <Setter Property="Visibility" Value="Collapsed"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Canvas.Resources>
                        <control:TaskListControl TaskList="{Binding TaskList}" UserStory="{Binding}" Margin="5" Width="290" Height="190" HorizontalAlignment="Stretch"/>
                    </Canvas>
                    <Viewbox Stretch="UniformToFill" Height="30">
                        <s:SurfaceButton Name="taskListButton" Content="open task list" Foreground="Gray" HorizontalContentAlignment="Center" Width="300" 
                                         Command="{x:Static content:BacklogScreen.ShowTaskListCommand}" CommandParameter="{Binding ElementName=taskListCanvas}"/>
                    </Viewbox>
                </StackPanel>
                <s:ElementMenu HorizontalAlignment="Right" VerticalAlignment="Top" ActivationMode="AlwaysActive" ActivationHost="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type s:ScatterViewItem}}}">
                    <s:ElementMenuItem Header="Mail" Icon="{StaticResource IconMail}" Command="{x:Static content:BacklogScreen.ShowMessageCommand}" CommandParameter="{Binding Path=Header, RelativeSource={x:Static RelativeSource.Self}}"/>
                    <s:ElementMenuItem Header="Edit" Icon="{StaticResource IconFileEdit}" Command="{x:Static content:BacklogScreen.StoryCardMenuEditCommand}" CommandParameter="{Binding}"/>
                    <s:ElementMenuItem Header="Trash" Icon="{StaticResource IconFileTrash}" Command="{x:Static content:BacklogScreen.ShowMessageCommand}" CommandParameter="{Binding Path=Header, RelativeSource={x:Static RelativeSource.Self}}"/>
                    <s:ElementMenuItem Header="Help" Icon="{StaticResource IconFileHelp}" Command="{x:Static content:BacklogScreen.ShowMessageCommand}" CommandParameter="{Binding Path=Header, RelativeSource={x:Static RelativeSource.Self}}"/>
                </s:ElementMenu>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="ScatterViewTaskItemDataTemplate">
            <Grid Background="#FFE3E4E2" Width="320" Height="250">                                 
                <control:TaskCardContent x:Name="taskContent" TaskName="{Binding TaskName, Mode=TwoWay}" TaskContent="{Binding TaskContent, Mode=TwoWay}" Width="320" Height="240" VerticalAlignment="Bottom"/>
                <Viewbox HorizontalAlignment="Left" Height="22" Stretch="Fill" VerticalAlignment="Top" Width="22" d:LayoutOverrides="Width, Height">
                    <s:SurfaceButton Style="{StaticResource CircleButton}" Width="20" Height="20" Margin="0"
                                     Command="{x:Static content:BacklogScreen.ScatterViewDeleteTaskCardCommand}" CommandParameter="{Binding}"/>
                </Viewbox>
                <Viewbox HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,30" Height="22" Width="22" Stretch="Fill" d:LayoutOverrides="Width, Height">
                    <s:SurfaceButton Name="IsEditableButton" Margin="0" Width="20" Height="20" Background="Transparent"
                                     Command="{x:Static content:BacklogScreen.ScatterViewTaskCardEditSwitchCommand}" CommandParameter="{Binding}">
                        <s:SurfaceButton.Style>
                            <Style TargetType="s:SurfaceButton">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsTaskCardEditable}" Value="True">
                                        <Setter Property="ContentTemplate" Value="{StaticResource LockIcon}"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding IsTaskCardEditable}" Value="False">
                                        <Setter Property="ContentTemplate" Value="{StaticResource EditIcon}"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>                           
                        </s:SurfaceButton.Style>                        
                    </s:SurfaceButton>
                </Viewbox>
            </Grid>
        </DataTemplate>

        <Style x:Key="CursorStyle" TargetType="{x:Type ContentControl}">
            <Setter Property="ContentTemplate" Value="{StaticResource ProductBacklogItemDataTemplate}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ContentControl}">
                        <Border BorderBrush="White" BorderThickness="1">
                            <ContentPresenter
                                Content="{TemplateBinding Content}" 
                                ContentTemplate="{TemplateBinding ContentTemplate}">
                            </ContentPresenter>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ScatterCursorStyle" TargetType="{x:Type ContentControl}">
            <Setter Property="ContentTemplate" Value="{StaticResource ScatterViewItemDataTemplate}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ContentControl}">
                        <ContentPresenter
                                Content="{TemplateBinding Content}" 
                                ContentTemplate="{TemplateBinding ContentTemplate}">
                        </ContentPresenter>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>            
        </Style>

        <Style x:Key="ScatterTaskCursorStyle" TargetType="{x:Type ContentControl}">
            <Setter Property="ContentTemplate" Value="{StaticResource ScatterViewTaskItemDataTemplate}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ContentControl}">
                        <!--<Border BorderBrush="White" BorderThickness="1">-->
                        <ContentPresenter
                                Content="{TemplateBinding Content}" 
                                ContentTemplate="{TemplateBinding ContentTemplate}">
                        </ContentPresenter>
                        <!--</Border>-->
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="ListBoxItem" x:Key="ContainerStyle">
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <ControlTemplate.Resources>
                            <Storyboard x:Key="OnDragOver1">
                                <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Border">
                                    <EasingColorKeyFrame KeyTime="0:0:0.5" Value="#FF87BEF3">
                                        <EasingColorKeyFrame.EasingFunction>
                                            <CircleEase EasingMode="EaseOut"/>
                                        </EasingColorKeyFrame.EasingFunction>
                                    </EasingColorKeyFrame>
                                    <EasingColorKeyFrame KeyTime="0:0:1" Value="White">
                                        <EasingColorKeyFrame.EasingFunction>
                                            <CircleEase EasingMode="EaseOut"/>
                                        </EasingColorKeyFrame.EasingFunction>
                                    </EasingColorKeyFrame>
                                </ColorAnimationUsingKeyFrames>
                            </Storyboard>
                        </ControlTemplate.Resources>
                        <Border Name="Border" Padding="2" SnapsToDevicePixels="true" Background="#FFF7F9FB" Opacity="0.8">
                            <ContentPresenter/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <EventTrigger RoutedEvent="s:SurfaceDragDrop.DragEnter">
                                <BeginStoryboard Storyboard="{StaticResource OnDragOver1}"/>
                            </EventTrigger>
                            <Trigger Property="Selector.IsSelected" Value="False"/>
                            <Trigger Property="IsSelected" Value="true"/>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Storyboard x:Key="canvas.Close">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="canvas">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="90"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="canvas">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.7"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="canvas">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.7"/>
            </DoubleAnimationUsingKeyFrames>
            <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="canvas">
                <EasingThicknessKeyFrame KeyTime="0" Value="0"/>
                <EasingThicknessKeyFrame KeyTime="0:0:0.5" Value="-508,0,0,0"/>
            </ThicknessAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="canvas">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-4"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="Label.Shiny" RepeatBehavior="Forever">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[2].(GradientStop.Offset)" Storyboard.TargetName="stackPanel">
                <EasingDoubleKeyFrame KeyTime="0:0:2" Value="0.987"/>
                <EasingDoubleKeyFrame KeyTime="0:0:4" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="stackPanel">
                <EasingColorKeyFrame KeyTime="0" Value="#E6F9F9F9"/>
                <EasingColorKeyFrame KeyTime="0:0:2" Value="#E6333333"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="stackPanel">
                <EasingColorKeyFrame KeyTime="0:0:2" Value="#F9E5E5E5"/>
            </ColorAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="canvas.Open">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="canvas">
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="canvas">
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="canvas">
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="canvas">
                <EasingThicknessKeyFrame KeyTime="0:0:0.5" Value="0">
                    <EasingThicknessKeyFrame.EasingFunction>
                        <CircleEase EasingMode="EaseOut"/>
                    </EasingThicknessKeyFrame.EasingFunction>
                </EasingThicknessKeyFrame>
            </ThicknessAnimationUsingKeyFrames>
        </Storyboard>

    </UserControl.Resources>

    <UserControl.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="stackPanel">
            <BeginStoryboard x:Name="Label_Shiny_BeginStoryboard" Storyboard="{StaticResource Label.Shiny}"/>
        </EventTrigger>
    </UserControl.Triggers>

    <Grid Name="grid">      

        <s:TagVisualizer Name="Visualizer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" VisualizationAdded="Visualizer_VisualizationAdded">
            <s:TagVisualizer.Definitions>
                <s:TagVisualizationDefinition Value="0xC0" TagRemovedBehavior="Fade" Source="/Tags/TagVisualTaskCard.xaml" PhysicalCenterOffsetFromTag="2,2" LostTagTimeout="1000"/>
                <s:TagVisualizationDefinition Value="0x0A"/>
            </s:TagVisualizer.Definitions>
            <s:ScatterView Name="ScatterView" AllowDrop="True" Margin="0" ItemsSource="{Binding}"  Background="Transparent" ItemTemplateSelector="{StaticResource ScatterViewItemDataTemplateSelector}"      
                       PreviewTouchDown="ScatterViewOnDragSourcePreviewTouchDown"
                       s:SurfaceDragDrop.Drop="ScatterViewTargetDrop"
                       s:SurfaceDragDrop.DragCompleted="ScatterViewDragCompleted"                      
                       >

                <!--<s:ScatterViewItem Name="ProductSVI" Orientation="0" CanRotate="False" Center="200,530" MinHeight="20" Width="300" Height="1000" Background="Transparent">
                    <Border BorderBrush="Gray" BorderThickness="3">
                        <StackPanel Orientation="Vertical">
                            <TextBlock Foreground="White" Text="Product Backlog" FontSize="30" VerticalAlignment="Top" HorizontalAlignment="Center" TextAlignment="Center" FontFamily="Tekton Pro" Width="{Binding ElementName=ProductSVI, Path=ActualWidth}"/>
                            <s:SurfaceListBox Name="ProductBacklog" BorderBrush="Gray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="980" Width="{Binding ElementName=ProductSVI, Path=ActualWidth}" MinHeight="0" 
                                  ItemTemplate="{StaticResource ProductBacklogItemDataTemplate}" AllowDrop="True" ItemsSource="{Binding ElementName=Backlog, Path=ProductBacklogItems}" ItemContainerStyle="{StaticResource ContainerStyle}" 
                                  ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                  PreviewTouchDown="ListBoxOnDragSourcePreviewTouchDown"
                                  PreviewMouseLeftButtonDown="ListBoxOnDragSourcePreviewTouchDown"
                                  s:SurfaceDragDrop.Drop="ProductBacklog_OnDropTargetDrop"
                                  s:SurfaceDragDrop.DragCanceled="ProductBacklog_DragCanceled"
                                  s:SurfaceDragDrop.DragCompleted="ProductBacklog_DragCompleted"                                  
                                  >
                            </s:SurfaceListBox>                            
                        </StackPanel>
                    </Border>
                </s:ScatterViewItem>-->

                <s:ScatterViewItem Name="SprintSVI" Orientation="0" CanRotate="False" CanScale="True" Center="1700,280" MinHeight="20" Width="300" Height="550" Background="Transparent">
                    <Border BorderBrush="Gray" BorderThickness="3">
                        <StackPanel Orientation="Vertical">
                            <TextBlock Foreground="White" Text="Sprint Backlog" FontSize="30" VerticalAlignment="Top" HorizontalAlignment="Center" FontFamily="Tekton Pro"/>
                            <s:SurfaceListBox Name="SprintBacklog" BorderBrush="Gray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="300" Height="490" MinHeight="0"
                            ItemTemplate="{StaticResource ProductBacklogItemDataTemplate}" AllowDrop="True" ItemContainerStyle="{StaticResource ContainerStyle}" ItemsSource="{Binding ElementName=Backlog, Path=SprintBacklogItems}"
                            ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Hidden"
                            PreviewTouchDown="ListBoxOnDragSourcePreviewTouchDown"
                            PreviewMouseLeftButtonDown="ListBoxOnDragSourcePreviewTouchDown"
                            s:SurfaceDragDrop.Drop="SprintBacklog_OnDropTargetDrop"
                            s:SurfaceDragDrop.DragCanceled="SprintBacklog_DragCanceled"
                            s:SurfaceDragDrop.DragCompleted="SprintBacklog_DragCompleted"
                            >
                            </s:SurfaceListBox>
                            <TextBlock Text="      " FontSize="20" Width="300"/>
                        </StackPanel>
                    </Border>
                </s:ScatterViewItem>

                <s:ScatterViewItem Name="BurnDownChartSVI" Orientation="0" CanMove="True" CanRotate="True" CanScale="True" Center="1610, 780" MinHeight="80" MinWidth="120" Height="320" Width="480" Background="White">
                    <control:BurnDownChart x:Name="burnDownChart" Width="{Binding ElementName=BurnDownChartSVI, Path=ActualWidth}" Height="{Binding ElementName=BurnDownChartSVI, Path=ActualHeight}" Background="Transparent" ChartItems="{Binding ElementName=Backlog, Path=SprintBacklogItems}"/>                  
                </s:ScatterViewItem>

            </s:ScatterView>
        </s:TagVisualizer>

        <Canvas x:Name="canvas" Tag="Closed" HorizontalAlignment="Left" Height="{Binding ActualHeight, ElementName=grid}" VerticalAlignment="Top" Width="330" Background="#663F4045" RenderTransformOrigin="0.5,0.5" Margin="-508,0,0,0">
            <Canvas.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="0.7" ScaleY="0.7"/>
                    <SkewTransform/>
                    <RotateTransform Angle="90"/>
                    <TranslateTransform/>
                </TransformGroup>
            </Canvas.RenderTransform>
            <StackPanel Width="{Binding ActualWidth, ElementName=canvas}" Height="{Binding ActualHeight, ElementName=canvas}">
                <StackPanel x:Name="stackPanel" Height="50" Opacity="0.695" Orientation="Horizontal">
                    <StackPanel.Background>
                        <LinearGradientBrush EndPoint="1.003,0.477" StartPoint="0.009,0.487">
                            <GradientStop Color="#E6333333" Offset="0"/>
                            <GradientStop Offset="1" Color="#E6272727"/>
                            <GradientStop Color="#F9E5E5E5" Offset="0.017"/>
                        </LinearGradientBrush>
                    </StackPanel.Background>
                    <s:SurfaceButton Content="Product Backlog" Margin="0" Width="{Binding ActualWidth, ElementName=stackPanel}" Height="{Binding ActualHeight, ElementName=stackPanel}" FontFamily="Tekton Pro" FontSize="30" HorizontalContentAlignment="Center"
                                     Click="SurfaceButton_Click"/>
                </StackPanel>
                <s:SurfaceListBox Name="ProductBacklog" BorderBrush="Gray" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="15,0,15,0" Height="972"
                                  ItemTemplate="{StaticResource ProductBacklogItemDataTemplate}" AllowDrop="True" ItemsSource="{Binding ElementName=Backlog, Path=ProductBacklogItems}" ItemContainerStyle="{StaticResource ContainerStyle}" 
                                  ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Hidden"
                                  PreviewTouchDown="ListBoxOnDragSourcePreviewTouchDown"
                                  PreviewMouseLeftButtonDown="ListBoxOnDragSourcePreviewTouchDown"
                                  s:SurfaceDragDrop.Drop="ProductBacklog_OnDropTargetDrop"
                                  s:SurfaceDragDrop.DragCanceled="ProductBacklog_DragCanceled"
                                  s:SurfaceDragDrop.DragCompleted="ProductBacklog_DragCompleted"                                  
                                  >
                </s:SurfaceListBox>
            </StackPanel>
        </Canvas>
    </Grid>
</UserControl>
